#include<stdio.h>


void turn(char arr[], int len)
{
    for (int i = 0; i < len / 2; i++)
    {
        char tmp = arr[i];
        arr[i] = arr[len - 1 - i];
        arr[len - 1 - i] = tmp;
    }
}
int main()
{
    char arr[10000] = { 0 };
    gets(arr);
    int Len = 0;
    int i = 0;
    while (arr[i])
    {
        Len++;
        i++;
    }
    turn(arr, Len);
    int k = 0;
    int begin = 0;
    while (arr[k - 1])
    {
        if (arr[k] >= 'a' && arr[k] <= 'z' || arr[k] >= 'A' && arr[k] <= 'Z')
        {
            k++;
        }
        else
        {
            for (int j = k - 1; j >= begin; j--)
            {
                printf("%c", arr[j]);
            }
            printf(" ");
            k++;
            begin = k;
        }
    }
    return 0;
}